package com.zhj.util.state.chain;

import com.zhj.util.state.enems.PreRegEventEnum;

/**
 * @author zhj
 * @create 2024-04-18-15:46
 */
public class Test {

    public static void main(String[] args) {
        System.out.println("Chain State Machine Test!");
        PreRegStateMachine preRegStateMachine = new PreRegStateMachine();
        try {
            preRegStateMachine.getCurrentState();
            preRegStateMachine.handleEvent(PreRegEventEnum.REG);
            preRegStateMachine.getCurrentState();
            preRegStateMachine.handleEvent(PreRegEventEnum.REG_CANCEL);
            preRegStateMachine.getCurrentState();
            preRegStateMachine.handleEvent(PreRegEventEnum.HOSPITAL_CANCEL);
            preRegStateMachine.getCurrentState();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
